//-------------------------------------------------------------------
//	Copyright (c) 2010-2011  Zhirnov Andrey
//	This file is part of the "UXGEN_ResourceConverter" project.
//	See copyright notice in "Converter.h".
//-------------------------------------------------------------------

#ifndef _RC_CONVERTER_CORE_H
#define _RC_CONVERTER_CORE_H

#include "stdafx.h"
#include "..\\Converters\\AllConverters.h"
#include "..\\Converters\\Texture\\ILWrapper.h"


class CConverter : public IConverter
{
private:
	TSubSystems			_sSubSys;

	CTextureConverter	*_pTexConv;
	CFontConverter		*_pFontConv;
	CModelConverter		*_pModelConv;
	CSoundConverter		*_pSoundConv;
	CTerrainConverter	*_pTerConv;
	CSpriteConverter	*_pSprConv;
	ILWrapper			*_pILWrap;

	string_array_t		_aErrors;

public:
	CConverter();
	~CConverter();

	HRESULT CALLBACK GetErrorsCount(uint &uCount);
	HRESULT CALLBACK GetErrorString(char *pcBuffer, uint uCount, uint &uWritten);
	HRESULT CALLBACK AddErrorString(const char *pcString);

	HRESULT CALLBACK GetSubSystem(E_SUBSYSTEM_TYPE eType, ISubSystem *&pSubSys);
	HRESULT CALLBACK GetVersion(uint &uMajor, uint &uMinor);
	HRESULT CALLBACK GetEngineVersion(uint &uVersion);

	HRESULT LoadFile(const char *pcFileName, IFilePtr &prFile, e_file_open_flags::type eFlags);
	bool	FileExist(const char *pFileName);
	bool	DirectoryExist(const char *pDirName);
	bool	NewDirectory(const char *pDirName);

	IBASE_IMPLEMENTATION( IConverter )
};

#endif	// _RC_CONVERTER_CORE_H